﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;

public partial class DWGM_Get : System.Web.UI.Page
{
    string id = string.Empty;
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            id = Request.Params["id"];

            string idd=Request.Params["idd"];
        }
        catch
        {
            Response.Write("错误:参数错误!");
            return;
        }
        BindDateList();
        
    }
    void BindDateList()
    {
        DBCls db = new DBCls();
        string sql = "select KeyUnitName,PerformanceState,PerformanceInfo,PerformanceID,WriteTime from Performance where PerformanceID='" + id + "'";
        SqlDataReader sqlReader = db.SqlReader(sql);

        DataTable Dt = new DataTable();
        DataRow dr;
        Dt.Columns.Add("F_KeyUnitName", typeof(string));    //单位名称 F_WriteTime
        Dt.Columns.Add("F_PerformanceState", typeof(string));   //是否完成
        Dt.Columns.Add("F_KeyUnitInfo", typeof(string));    //单位信息
        Dt.Columns.Add("F_ID", typeof(string));     //主键
        Dt.Columns.Add("F_WriteTime", typeof(string));      //录入时间
        while (sqlReader.Read())
        {
            dr = Dt.NewRow();
            dr[0] = sqlReader[0].ToString();
            dr[1] = sqlReader[1].ToString();
            dr[2] = sqlReader[2].ToString();
            dr[3] = sqlReader[3].ToString();
            dr[4] = sqlReader[4].ToString();
            Dt.Rows.Add(dr);
        }
        sqlReader.Close();
        this.ImageList.DataSource = new DataView(Dt);
        this.ImageList.DataBind();

        //System.Text.StringBuilder strb = new System.Text.StringBuilder();
        //   System.IO.StringWriter sw = new System.IO.StringWriter( strb );
        //   System.Web.UI.HtmlTextWriter htw = new HtmlTextWriter( sw );

        //   //执行控件的render并输出到HtmlTextWriter里
        //   ImageList.RenderControl(htw);

        //   string s = strb.ToString();
        //   //Response.Write(s);
           

    }

    protected override void Render(HtmlTextWriter writer)
    {
        this.ImageList.RenderControl(writer);
    }
}
